<?php

use yii\db\Migration;

/**
 * Handles adding columns to table `{{%project}}`.
 */
class m221222_111920_add_contract_columns_to_project_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('{{%project}}', 'contract_date_sign', $this->date());
        $this->addColumn('{{%project}}', 'contract_date_realize', $this->date());
        $this->addColumn('{{%project}}', 'contract_filename', $this->string());
        $this->addColumn('{{%project}}', 'contract_subject', $this->string(512));
        $this->addColumn('{{%project}}', 'contract_price', $this->money());
        $this->addColumn('{{%project}}', 'contract_registry_number', $this->integer());
        $this->addColumn('{{%project}}', 'contract_own_number', $this->string());
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropColumn('{{%project}}', 'contract_date_sign');
        $this->dropColumn('{{%project}}', 'contract_date_realize');
        $this->dropColumn('{{%project}}', 'contract_filename');
        $this->dropColumn('{{%project}}', 'contract_subject');
        $this->dropColumn('{{%project}}', 'contract_price');
        $this->dropColumn('{{%project}}', 'contract_registry_number');
        $this->dropColumn('{{%project}}', 'contract_own_number');
    }
}
